<template>
	
		<el-row :gutter="5">
			<el-col :span="toggle?0:6">
				<xm-phase  :sel-project="projectInfo" :params="{milestone:'1'}" @check-change="onPhaseRowClick" v-if="hadInit"/>
			</el-col>
			<el-col :span="toggle?24:18">
				<xm-task-mng   :sel-project="projectInfo" :params="{milestone:'1',ntype:'0'}" :parent-task="parentTask" >
				<template #expandBtn>
					<el-button :icon="toggle?'DArrowRight':'DArrowLeft'" @click="onToggleClick" plain title="展开/收起左边"/>
				</template>
			</xm-task-mng>
			</el-col>
		</el-row>
	
</template>

<script>
	import util from '@/components/mdp-ui/js/util';//全局公共库

	import { mapState } from 'pinia'
import { useUserStore } from '@/store/modules/user'
import { useXmStore } from '@/store/modules/xm'

  	import  XmPhase from '@/views/xm/core/xmTask/XmPhase.vue';//新增界面
 	import  XmTaskMng from '@/views/xm/core/xmTask/XmTaskMng.vue';//新增界面
	export default {

		components: {
			XmPhase,XmTaskMng
		},
		computed: {
		    ...mapState(useUserStore,[
		      'userInfo','roles' 
		    ]),

		    ...mapState(useXmStore,[
		       'projectInfo'
		    ]),

        },
		watch: {

	    },
		data() {
			return {
				parentTask:null,
				toggle: true,
				hadInit: false, 
  
			}//end return
		},//end data
		methods: {
			 onToggleClick(){
				this.toggle=!this.toggle
				if(!this.hadInit){
					this.hadInit=true
				}
			 },
			 onPhaseRowClick(task,checked){
				if(checked){
					this.parentTask=task
				}else{
					this.parentTask=null
				} 
			 }
		},//end method
		mounted() {


		}//end mounted
	}

</script>

<style lang="less" scoped />
